package com.hutianao.gqgl.department.repository;

import com.hutianao.gqgl.department.entity.SearchDepartmentEntity;
import com.hutianao.gqgl.job.entity.SearchJobEntity;
import com.hutianao.gqgl.mybatis.entity.PtDepartmentEntity;
import com.hutianao.gqgl.mybatis.entity.PtJobEntity;
import com.hutianao.gqgl.mybatis.entity.PtUserEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PaddingEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PadingRstType;
import com.hutianao.gqgl.mybatis.ztree.ZtreeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.jdbc.UncategorizedSQLException;
import org.springframework.jdbc.UncategorizedSQLException;

import java.util.List;

@Mapper
public interface DepartmentDao {

    List<ZtreeEntity> queryLeftTree();
    void deleteDepartInfoByIds(@Param("depUuid")String depUuid);


    void unboundParentIdByDepUuid(@Param("depUuid")String depUuid, @Param("belongCenter")String belongCenter);

    PtDepartmentEntity queryDepartListById(@Param("depUuid") String depUuid);


    List<ZtreeEntity> queryBoundDepartTree();

    String queryParentId(@Param("depUuid") String depUuid);

    void saveParentIdByDepUuid(String depUuid, String parentId);

    List<ZtreeEntity> queryDepartTree(String depUuid);

    void saveBelongCenterIdByDepUuid(@Param("depUuid")String depUuid, @Param("belongCenter")String belongCenter);

    List<PtDepartmentEntity> queryDepartInfoListByPage(@Param("search") SearchJobEntity search, @Param("padding") PaddingEntity padding);


    Integer queryDepartInfoListTotal(@Param("search") SearchJobEntity search);

    List<PtUserEntity> queryUserInfoListByPage(@Param("entity") SearchDepartmentEntity entity, @Param("padding")PaddingEntity paddingEntity);


    List<PtUserEntity> queryUserListByPage(@Param("entity") SearchDepartmentEntity entity, @Param("padding")PaddingEntity paddingEntity);
    int querySubdep(@Param("depUuid") String depUuid);
    int querySubuser(@Param("depUuid") String depUuid);
    void insertDepartInfo(@Param("entity")PtDepartmentEntity ptDepartEntity);
    void updateDepartById(@Param("entity") PtDepartmentEntity ptDepartEntity);
    List<PtJobEntity> queryDutyListByPage(@Param("search")SearchDepartmentEntity search, @Param("padding")PaddingEntity padding);

}
